<script lang="ts" setup>
import son from '@/components/myc/bb.vue'
import {ref, inject} from 'vue'

const a33 = ref([])
const a11 = ref('')

function show1(data: any): void {
  a11.value = data
}

function show2(a: any): void {
  console.log(a)
  //a33.value = a
}

function show3(a: any): void {
  a33.value = a
}
</script>

<template>

  <div class="aa">
    <p>App.vue pid = {{ inject('pid') }}</p>
    <p>App.vue uid = {{ inject('uid') }}</p>
    <br>
    <h3>parent 父组件(aa.vue)</h3>
    <son/>
    <br>
    <!-- 父组件通过子组件的属性进行传值给子组件 -->
    <son id="父组件数据id99"/>

    <son @a1="show1" @a2="show2" @a3="show3"></son>
    <p>{{ a11 }}</p>
    <span v-for="item in a33">{{ item }}</span>

  </div>
</template>

<style scoped>
.aa {
  width: 300px;
  height: 800px;
  color: #fff;
  background-color: #dc0b0b;
}
</style>
